package at.irian.jsfatwork.broker.domain.stock;

import java.math.BigDecimal;
import java.math.MathContext;

/**
 * @author Thomas Spiegl
 */
public class Quote {

    private Stock stock;

    private BigDecimal amount;

    public Quote(Stock stock, BigDecimal amount) {
        this.stock = stock;
        this.amount = amount;
    }

    public Stock getStock() {
        return stock;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public BigDecimal calculateAmount(Integer quanity) {
        return this.amount.multiply(new BigDecimal(quanity), MathContext.DECIMAL32);
    }
}
